package com.enation.app.javashop.core.client.fallback.distribution;

import com.enation.app.javashop.core.client.feignimpl.distribution.DistributionSellerBillClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.enation.app.javashop.model.distribution.dto.DistributionSellerBillDTO;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 分销结算单相关熔断 factory
 * @author kingapex
 * @version 1.0
 * @data 2022/5/28 14:10
 **/
@Component
public class DistributionSellerBillClientFallbackFactory extends BaseFallbackFactory<DistributionSellerBillClientFeignImpl> {
    @Override
    protected DistributionSellerBillClientFeignImpl fallback() {
        return new DistributionSellerBillClientFallback();
    }

    /**
     * 分销结算单相关熔断
     *
     * @author zh
     * @version v7.0
     * @date 18/9/27 下午12:16
     * @since v7.0
     */
    @Component
    public static class DistributionSellerBillClientFallback implements DistributionSellerBillClientFeignImpl {

        private final Logger logger = LoggerFactory.getLogger(getClass());

        @Override
        public List<DistributionSellerBillDTO> countSeller(Integer startTime, Integer endTime) {
            logger.error("获取某个周期的返利信息出错,开始时间" + startTime + ",结束时间" + endTime);

            return null;
        }
    }
}
